<!--
* 添加页面
* @author chenyi
* @email qq228112142@qq.com
* @date 2017-08-08 17:35:59
*-->
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <%@ include file="/common/jsp/resource.jsp" %>
</head>
<body>
<div class="layui-field-box">
    <form class="layui-form" action="">
             <div class="layui-form-item">
            <label class="layui-form-label">主键</label>
            <div class="layui-input-normal">
                <input type="text"  name="id"  lay-verify="required" placeholder="请输入主键"  class="layui-input">
            </div>
        </div>
              <div class="layui-form-item">
            <label class="layui-form-label">云支付账号</label>
            <div class="layui-input-normal">
                <input type="text"  name="account"  lay-verify="required" placeholder="请输入云支付账号"  class="layui-input">
            </div>
        </div>
              <div class="layui-form-item">
            <label class="layui-form-label">姓名</label>
            <div class="layui-input-normal">
                <input type="text"  name="name"  lay-verify="required" placeholder="请输入姓名"  class="layui-input">
            </div>
        </div>
              <div class="layui-form-item">
            <label class="layui-form-label">电话</label>
            <div class="layui-input-normal">
                <input type="text"  name="phone"  lay-verify="required" placeholder="请输入电话"  class="layui-input">
            </div>
        </div>
              <div class="layui-form-item">
            <label class="layui-form-label">推荐码</label>
            <div class="layui-input-normal">
                <input type="text"  name="recommendCode"  lay-verify="required" placeholder="请输入推荐码"  class="layui-input">
            </div>
        </div>
              <div class="layui-form-item">
            <label class="layui-form-label">团队码</label>
            <div class="layui-input-normal">
                <input type="text"  name="teamCode"  lay-verify="required" placeholder="请输入团队码"  class="layui-input">
            </div>
        </div>
              <div class="layui-form-item">
            <label class="layui-form-label">状态 0：禁用 1：启用</label>
            <div class="layui-input-normal">
                <input type="text"  name="state"  lay-verify="required" placeholder="请输入状态 0：禁用 1：启用"  class="layui-input">
            </div>
        </div>
              <div class="layui-form-item">
            <label class="layui-form-label">缴费时间</label>
            <div class="layui-input-normal">
                <input type="text"  name="payTime"  lay-verify="required" placeholder="请输入缴费时间"  class="layui-input">
            </div>
        </div>
              <div class="layui-form-item">
            <label class="layui-form-label">缴费金额</label>
            <div class="layui-input-normal">
                <input type="text"  name="payAmount"  lay-verify="required" placeholder="请输入缴费金额"  class="layui-input">
            </div>
        </div>
              <div class="layui-form-item">
            <label class="layui-form-label">推荐人云支付账号</label>
            <div class="layui-input-normal">
                <input type="text"  name="recommendAccount"  lay-verify="required" placeholder="请输入推荐人云支付账号"  class="layui-input">
            </div>
        </div>
              <div class="layui-form-item">
            <label class="layui-form-label">推荐下级人数</label>
            <div class="layui-input-normal">
                <input type="text"  name="recommendLowerNumber"  lay-verify="required" placeholder="请输入推荐下级人数"  class="layui-input">
            </div>
        </div>
              <div class="layui-form-item">
            <label class="layui-form-label">团队上级云支付账号</label>
            <div class="layui-input-normal">
                <input type="text"  name="teamParentAccount"  lay-verify="required" placeholder="请输入团队上级云支付账号"  class="layui-input">
            </div>
        </div>
              <div class="layui-form-item">
            <label class="layui-form-label">是否是首批</label>
            <div class="layui-input-normal">
                <input type="text"  name="isInit"  lay-verify="required" placeholder="请输入是否是首批"  class="layui-input">
            </div>
        </div>
              <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit="" lay-filter="submit">保存</button>
                <button class="layui-btn" onclick="closeWindow()"> 返回</button>
            </div>
        </div>
    </form>
</div>
<script>
    layui.use(['form'], function () {
        var form = layui.form();
        //监听提交
        form.on('submit(submit)', function (data) {
            $.ajax({
                url: "/member/save",
                type: "post",
                contentType: "application/json",
                data: JSON.stringify(data.field),
                async: false,
                dataType: "json",
                success: function (R) {
                    if (R.code === 0) {
                        alert('操作成功', function (index) {
                            closeWindow();
                        });
                    } else {
                        alert(R.msg);
                    }
                },
                error: function () {
                    alert("系统繁忙");
                }
            });
            return false;
        });
    });
</script>
</body>
</html>
